#ifndef _ROS_robik_ArmControl_h
#define _ROS_robik_ArmControl_h

#include <stdint.h>
#include <string.h>
#include <stdlib.h>
#include "ros/msg.h"
#include "std_msgs/Header.h"

namespace robik
{

  class ArmControl : public ros::Msg
  {
    public:
      std_msgs::Header header;
      uint32_t arm_clamp;
      uint32_t arm_roll;
      uint32_t arm_elbow;
      uint32_t arm_shoulder;
      uint32_t arm_yaw;
      uint32_t time_to_complete;

    virtual int serialize(unsigned char *outbuffer) const
    {
      int offset = 0;
      offset += this->header.serialize(outbuffer + offset);
      *(outbuffer + offset + 0) = (this->arm_clamp >> (8 * 0)) & 0xFF;
      *(outbuffer + offset + 1) = (this->arm_clamp >> (8 * 1)) & 0xFF;
      *(outbuffer + offset + 2) = (this->arm_clamp >> (8 * 2)) & 0xFF;
      *(outbuffer + offset + 3) = (this->arm_clamp >> (8 * 3)) & 0xFF;
      offset += sizeof(this->arm_clamp);
      *(outbuffer + offset + 0) = (this->arm_roll >> (8 * 0)) & 0xFF;
      *(outbuffer + offset + 1) = (this->arm_roll >> (8 * 1)) & 0xFF;
      *(outbuffer + offset + 2) = (this->arm_roll >> (8 * 2)) & 0xFF;
      *(outbuffer + offset + 3) = (this->arm_roll >> (8 * 3)) & 0xFF;
      offset += sizeof(this->arm_roll);
      *(outbuffer + offset + 0) = (this->arm_elbow >> (8 * 0)) & 0xFF;
      *(outbuffer + offset + 1) = (this->arm_elbow >> (8 * 1)) & 0xFF;
      *(outbuffer + offset + 2) = (this->arm_elbow >> (8 * 2)) & 0xFF;
      *(outbuffer + offset + 3) = (this->arm_elbow >> (8 * 3)) & 0xFF;
      offset += sizeof(this->arm_elbow);
      *(outbuffer + offset + 0) = (this->arm_shoulder >> (8 * 0)) & 0xFF;
      *(outbuffer + offset + 1) = (this->arm_shoulder >> (8 * 1)) & 0xFF;
      *(outbuffer + offset + 2) = (this->arm_shoulder >> (8 * 2)) & 0xFF;
      *(outbuffer + offset + 3) = (this->arm_shoulder >> (8 * 3)) & 0xFF;
      offset += sizeof(this->arm_shoulder);
      *(outbuffer + offset + 0) = (this->arm_yaw >> (8 * 0)) & 0xFF;
      *(outbuffer + offset + 1) = (this->arm_yaw >> (8 * 1)) & 0xFF;
      *(outbuffer + offset + 2) = (this->arm_yaw >> (8 * 2)) & 0xFF;
      *(outbuffer + offset + 3) = (this->arm_yaw >> (8 * 3)) & 0xFF;
      offset += sizeof(this->arm_yaw);
      *(outbuffer + offset + 0) = (this->time_to_complete >> (8 * 0)) & 0xFF;
      *(outbuffer + offset + 1) = (this->time_to_complete >> (8 * 1)) & 0xFF;
      *(outbuffer + offset + 2) = (this->time_to_complete >> (8 * 2)) & 0xFF;
      *(outbuffer + offset + 3) = (this->time_to_complete >> (8 * 3)) & 0xFF;
      offset += sizeof(this->time_to_complete);
      return offset;
    }

    virtual int deserialize(unsigned char *inbuffer)
    {
      int offset = 0;
      offset += this->header.deserialize(inbuffer + offset);
      this->arm_clamp =  ((uint32_t) (*(inbuffer + offset)));
      this->arm_clamp |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
      this->arm_clamp |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
      this->arm_clamp |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
      offset += sizeof(this->arm_clamp);
      this->arm_roll =  ((uint32_t) (*(inbuffer + offset)));
      this->arm_roll |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
      this->arm_roll |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
      this->arm_roll |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
      offset += sizeof(this->arm_roll);
      this->arm_elbow =  ((uint32_t) (*(inbuffer + offset)));
      this->arm_elbow |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
      this->arm_elbow |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
      this->arm_elbow |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
      offset += sizeof(this->arm_elbow);
      this->arm_shoulder =  ((uint32_t) (*(inbuffer + offset)));
      this->arm_shoulder |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
      this->arm_shoulder |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
      this->arm_shoulder |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
      offset += sizeof(this->arm_shoulder);
      this->arm_yaw =  ((uint32_t) (*(inbuffer + offset)));
      this->arm_yaw |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
      this->arm_yaw |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
      this->arm_yaw |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
      offset += sizeof(this->arm_yaw);
      this->time_to_complete =  ((uint32_t) (*(inbuffer + offset)));
      this->time_to_complete |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
      this->time_to_complete |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
      this->time_to_complete |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
      offset += sizeof(this->time_to_complete);
     return offset;
    }

    const char * getType(){ return "robik/ArmControl"; };
    const char * getMD5(){ return "2dac8164b4098239913187191cd77bec"; };

  };

}
#endif